package com.example.forum.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@Schema(description = "用户信息")
public class User {
    private Long id;

    @Schema(description = "用户名")
    private String username;

    @JsonIgnore // 表示不参与 JSON 序列化
    private String password;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "电话号")
    private String phoneNum;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "性别")
    private Byte gender;

    @JsonIgnore // 表示不参与 JSON 序列化
    private String salt;

    @JsonInclude(JsonInclude.Include.ALWAYS)
    @Schema(description = "头像地址")
    private String avatarUrl;

    @Schema(description = "发帖数量")
    private Integer articleCount;

    @Schema(description = "是否为管理员")
    private Byte isAdmin;

    @Schema(description = "个人简介")
    private String remark;

    @Schema(description = "用户状态")
    private Byte state;

    @JsonIgnore // 表示不参与 JSON 序列化
    private Byte deleteState;

    @Schema(description = "注册日期")
    private LocalDateTime createTime;

    private LocalDateTime updateTime;


}